<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/admin.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/main.css'); ?>">
<script type='text/javascript' src="<?php echo $this->_webroot('skin/js/jy.js'); ?>"></script>

<style>
td span {color:red;}
.green {color:green;}
.red {color:red;}
#divname{float:left; margin:0px;}
</style>
</head>
<body>
<input type="hidden" id="update_right" value="1" ></input>
<div id="maincontent">
	<div class="wrap">
	<div class="crumbs">当前位置 &gt;&gt; 商铺管理 &gt;&gt; 未审核商铺</div>
        <hr />
        <div class="seachbox">
            <div class="content2">
            	<form action="<?php echo $this->_url('admin/shop/request/');?>" name="searchForm" method="get">
                <table class="form-table">
                	<tbody>
                	<tr>
                		<td width="10px"><img src="<?php echo $this->_webroot('skin/images/icon_search.gif'); ?>" border="0" alt="SEARCH" /></td>
                       	<td width="36px">
                       		状态：
                       	</td>
                       	<td width="50px">
                       		<select name="s">
							<option value='10' <?php if($s=='10'){echo "selected";} ?> >全部显示</option>
							<option value='1' <?php if($s=='1'){echo "selected";} ?>>已通过审核</option>
							<option value='100' <?php if($s=='100'){echo "selected";} ?>>等待审核</option>
							<option value='2' <?php if($s=='2'){echo "selected";} ?>>已拒绝审核</option>
							</select>
                       	</td>
                        <td ><span class="button-container"><input class="regular-button" type="submit" value="搜索" /></span></td>
                      </tr>
                    </tbody>
                </table>
                </form>
            </div>
        </div>	
	<div class="infobox">
	<h3><?php 
	if($s=='10'){echo '全部显示';} 
	if($s=='1'){echo '已通过审核';} 
	if($s=='2'){echo '已拒绝审核';}
	if($s=='100'){echo '等待审核';}?></h3>
    <div class="content2">
		<form action="<?php echo $this->_url('admin/shop/dorequest/');?>" name="form1" method="post">
		<table class="list_table">
		  <thead>
            <tr style="text-align:center;">
				<th width="2px"><input type="checkbox" value="" onclick="checkall(this,'request_id[]');"></th>
				<th width="20px">ID</th>
				<th width="" align="left">商铺名称</th>
				<th width="55px">证件查看</th>
				<th width="121px">申请时间</th>
				<th width="60px">状态</th>
				<th width="70px">操作</th>
			</tr>
			</thead>
			<tbody>
			<?php if($result['data']) {
			foreach($result['data'] as $value) { ?>
			<tr style="text-align:center;">
				<td><input type="checkbox" name="request_id[]" value="<?php echo $value['shoprequest']['id'];?>" /></td>
				<td><?php echo $value['shoprequest']['id'];?>.</td>
				<td align="left"><?php echo $value['shopinfo']['shop_name'];?></td>
				<td><a href="<?php echo $this->_url('admin/shop/requestview/?');?>id=<?php echo $value['shoprequest']['id']; ?>" >查看</a></td>
				<td><?php echo substr($value['shoprequest']['created'],0,16);?></td>
				<td><?php if($value['shoprequest']['status']==1) {echo "<span class='green'>通过审核</span>";}
					elseif($value['shoprequest']['status']==2) {echo "<span class='red'>审核失败</span>";}
					else {echo '等待审核';} ?>
				</td>
				<td class="center">
				<a href="<?php echo $this->_url('admin/shop/requestview/?');?>id=<?php echo $value['shoprequest']['id']; ?>" >查看</a><br />
				<?php if($value['status']!=1) { ?>
				<a href="<?php echo $this->_url('admin/shop/dorequest/?');?>s=1&id=<?php echo $value['shoprequest']['id']; ?>">通过</a>
				<a href="<?php echo $this->_url('admin/shop/dorequest/?');?>s=2&id=<?php echo $value['shoprequest']['id']; ?>">未通过</a>
				<?php } ?>
				</td>
			</tr>
			<?php }?>
			<tr>
				<td colspan="7">
				<span style="margin:14px 14px 0px 0px; float:left;" >
					<select name="s">
						<option value="1">通过</option>
						<option value="2">不通过</option>
					</select>
				</span>
					<span class="button-container"><input type="submit" name="" class="regular-button"  onclick="return delcheck();" value="批量操作" /></span>
				</td>
			</tr>
			<?php } else { ?>
			<tr>
				<td colspan="7">暂无信息</td>
			</tr>
			<?php } ?>
			<tr>
				<td colspan="7">
					<a href="<?php echo $result['page']['head'];?>">首页</a> 
                            <a href="<?php echo $result['page']['prevPage'];?>">上一页</a> 
                            <?php foreach($result['page']['plist'] as $k => $v ) { ?>							
                            <a href="<?php echo $v; ?>"><?php echo $k; ?></a>
							<?php } ?>
                            <a href="<?php echo $result['page']['nextPage'];?>">下一页</a> 
                            <a href="<?php echo $result['page']['foot'];?>">尾页</a> 
                            当前第<?php echo $result['page']['current']['num'];?>页/共<?php echo $result['page']['pageCount'];?>页				
				</td>
			</tr>
		</table>
		</form>
	   </div>
	  </div>		
		

	</div>
</div>
<script language="JavaScript" src="<?php echo $this->_webroot('servtools/ajax_client/ajax.js'); ?>"></script>
<script>
var inputs = document.getElementsByTagName("input");
function delcheck(){
	var checked = false; 
    for (var i = 0; i < inputs.length; i++) 
    {
    	if (inputs[i].checked == true) 
        {
            checked = true;
            if(confirm('确定要执行此操作吗')){
            	break; 
            }else{
                return false;
                break; 
            }
        }
    } 
    if (!checked) 
    { 
        ShowMessageBox("请至少选择一个商铺！",'0'); 
        return false; 
    }
    return true;
}
</script>
</body>
</html>